package au.com.evoCoach.dao;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import au.com.evoCoach.domain.League;

@Repository
public class LeagueDAO extends BaseDAO {

	public LeagueDAO() {
		super(League.class);
	}
	
	public List<League> getLeagues(int year) {
		String sql = "from League";
       	Query query = getSession().createQuery(sql);
       	query.setParameter("year", year);
       	
       	return query.list();
	}
	
}
